﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using LogisticsBLL;
using Model;

namespace WebLosgic
{
    public partial class UserDetail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack) {
            
                if (Session["UserIDs"] != null)
                {
                    LabYONG.Text= Session["names"].ToString();
                    dail();
                }
                else
                {
                    this.ClientScript.RegisterStartupScript(this.GetType(), "error", "alert('请您先去登录');location.href='login.aspx'", true);

                }

            }
        }

        public  void dail()
        {
            int id =Convert.ToInt32(Session["UserIDs"]);
            UserBLL a = new UserBLL();
            Model.Users us   = a.usertab(id);
            int insex;
            int.TryParse(LabSex.Text, out insex);
            string Sext="";
            if (us.sex == 0)
            {
                Sext = "男";
            }
            else
            {
                Sext = "女";
            }
            //us.UserID =Convert.ToInt32(LabUserid.Text);
            LabName.Text = us.UserName;
            LabSex.Text = Sext;
            LabPhone.Text=us.phone;
            LabRole.Text=us.RoleName;
            LabEmail.Text =us.Email ;
             LabAcount.Text= us.Account;
            LabUserid.Text = id.ToString();
        }
    }
}